﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ViewBlog.aspx.cs" Inherits="InfoStuffStore.FormViewBlog" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        function ValidatePage() {
            var isvalid = true;
            if (document.getElementById("<%=txtName.ClientID %>").value == "") {
            isvalid = false;
            }
            if (document.getElementById("<%=txtEmailID.ClientID %>").value == "") {
                isvalid = false;
            }
            if (document.getElementById("<%=txtComment.ClientID %>").value == "") {
                isvalid = false;
            }

            if (!isvalid) {
                alert('All fields are required!');
                return false;
            }

            return true;
        }
</script>
    <div id="content">
        <h2 id="h2Title" runat="server"></h2>
        <div id="blogDesc" runat="server">
        </div>
         <hr />
        <h4>Comments</h4>
        <label for="Name">
            Name:</label>
        <asp:TextBox ID="txtName" runat="server" Width="450px" CssClass="required input_field"></asp:TextBox>
        <div class="cleaner h10">
        </div>
        <label for="EmailID">
            Email:</label>
        <asp:TextBox ID="txtEmailID" runat="server" Width="450px" CssClass="required input_field"></asp:TextBox>
        <div class="cleaner h10">
        </div>
        <label for="text">
            Comment:</label>
        <asp:TextBox ID="txtComment" TextMode="MultiLine" Width="450px" Height="70px" runat="server" CssClass="required input_field"></asp:TextBox>
       
        <div class="cleaner h10">
        </div>
        <asp:Button ID="btnSubmit" runat="server" Text="Submit"
            CssClass="submit_btn float_r" OnClick="btnSubmit_Click" OnClientClick="return ValidatePage();" />
        <br />
        <hr />
        <asp:DataList ID="GridBlogComments" runat="server" Width="100%">
            <ItemTemplate>
                <div>
                    <h6><%# DataBinder.Eval(Container.DataItem, "CommentText")%></h6>
                    <span style="float:right; margin-right:20px; font-size:11px; font-weight:bold;">By: <%# DataBinder.Eval(Container.DataItem, "Name")%></span>
                </div>
            </ItemTemplate>
        </asp:DataList>
        <div class="cleaner h50">
        </div>
    </div>
</asp:Content>
